<template>
  <div>
      <table class="table table-bordered">
        <tr>
          <td>投资人名称</td>
          <td>投资金额</td>
          <td>投资日期</td>
        </tr>
        <tr v-for = "item in list">
          <td>{{ item.UL_Name }}</td>
          <td>{{ item.UI_Money }}</td>
          <td>{{ item.UI_Date }}</td>
        </tr>
      </table>
  </div>
</template>

<script setup lang="ts">
  import {reactive,toRefs,onMounted} from 'vue'
  import { useRoute} from 'vue-router'
  import axios from 'axios';
  const route = useRoute();

  let data:any = reactive({
    list:[]
  })

  let { list } = toRefs(data)

  onMounted(()=>{
    getList()
  })

  //根据投资的ID编号查询当前项目有那些人进行投资了
  const getList = ()=>{
     
      axios({
        url:'/api/Invest/GetAllUsersInvestInfos',
        method:"get",
        params:{
          Iid:route.query.id
        }
      })
      .then(res=>{
        console.log(res);
        list.value = res.data.data
        
      })
      .catch(err=>{
        console.log(err);
        
      })
  }



</script>

<style scoped>

</style>